package com.ltt.controller;

import com.ltt.annotation.NoAuth;
import com.ltt.dao.pojo.Policy;
import com.ltt.dao.vo.Result;
import com.ltt.service.PolicyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ‘李天泰’
 * @version 1.0
 * @description: TODO
 * @date 2023/5/26 11:21
 */
@Api(tags = "政策模块")
@RestController
@RequestMapping("/policy")
public class PolicyController {
    @Autowired
    private PolicyService policyService;

    @NoAuth
    @ApiOperation("获取所有政策")
    @GetMapping("/getAllPolicy")
    public Result getAllPolicy(){
        List<Policy> allPolicy = policyService.getAllPolicy();
        return Result.successWithData(allPolicy);
    }
}
